package cl.indumotora.induapprecepcion.app;

import android.os.Bundle;
import android.app.Activity;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.Spinner;
import android.widget.Toast;

public class OperacionesActivity extends Activity {
	 
	 CheckBox chc_ocultar ;
	 Spinner sp_servicios;
	 
//	 spn_op_servicios
	 
	 private SeekBar volumeControl = null;
	 

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_operaciones);
        
        chc_ocultar = (CheckBox)findViewById(R.id.chk_id_serv);
        sp_servicios = (Spinner)findViewById(R.id.spn_op_servicios);
        
        chc_ocultar.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			
  			@Override
  			public void onCheckedChanged(CompoundButton buttonView,
  					  boolean isChecked) {
  			       if(isChecked)
  			    	   
  				  ((Spinner)findViewById(R.id.spn_op_servicios)).setVisibility(View.VISIBLE);
  			       
  				 else
  					 
  				  ((Spinner)findViewById(R.id.spn_op_servicios)).setVisibility(View.GONE);;
  				
  			}
  		});

 
    volumeControl = (SeekBar) findViewById(R.id.volume_bar);
 
        volumeControl.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
            int progressChanged = 0;
 
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
                progressChanged = progress;
            }
 
            public void onStartTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
            }
 
            public void onStopTrackingTouch(SeekBar seekBar) {
                Toast.makeText(OperacionesActivity.this,"seek bar progress:"+progressChanged, 
                        Toast.LENGTH_SHORT).show();
            }
        });
 
    }
 /*
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.layout.fragment_operaciones, menu);
        return true;
    }
 
*/


}
